<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="docmanager.engine.*"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Alta de Novedad</title>
</head>
<body>


   <script>
 function sinComillas(strString)
 {
 	if (strString.length == 0) return true;
     //alert("Hay comilla en " + strString.indexOf("'"));
 	if (strString.indexOf("'") != -1)
     	return false;
 	return true;
 }

 
 function validarForm()
{
  //alert("Validando Formulario");
  var x=document.forms["frmNovedad"]["texto"].value;
  if (x==null || x=="")
    {
    alert("Se debe escribir algo en el texto.");
    return false;
    }
  if (!sinComillas(x))
  {
  alert("No ingrese comillas en el texto.");
  return false;
  }
  
  return true;
}
</script>


 <form name="frmNovedad" method="post" action="DMController" onsubmit="return validarForm()">
  <input type="hidden" name="op" value="AgregarNovedad2">
  Texto: <br>
  <textarea name="texto" rows= 4 value="" cols=45> 
  </textarea>
  <br>
  
  <input type=submit value="Publicar">

<script type="text/javascript">
<%
String serverPath = DMController.getServerPath(request);
%>    
function execMenuPrincipal()
{
    document.location.href = "<%=serverPath%>/DMController?op=MenuPrincipal"
}

</script>
<input type="button" value="Menu Principal" name="menuPrincipal" onclick="execMenuPrincipal();">


 </form>

</body>
</html>